<?php

namespace App\Admin\Renderable;

use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;
use App\Models\WorkUser;

class WorkUserDetails extends LazyRenderable
{
    public function grid(): Grid
    {
        return Grid::make(new WorkUser(), function (Grid $grid) {
            $grid->model()->where('id_card', $this->payload['id_card']);
            $grid->column('photo_portrait','人像面')->image('','80','80');
            $grid->column('photo_emblem','国徽面')->image('','80','80');
            $grid->column('id_card','身份证号');
            $grid->column('mobile','手机号');
            $grid->column('bank_deposit','开户银行');
            $grid->column('bank_number','银行卡号');
            $grid->disableActions();
//            $grid->column('enter_time','入职时间');
//            $grid->column('exit_time','离职时间');
//            $grid->quickSearch(['id', 'name', 'id_card']);
//            $grid->paginate(10);
//            $grid->filter(function (Grid\Filter $filter) {
//                $filter->like('username')->width(4);
//                $filter->like('name')->width(4);
//            });

        });
    }
}
